From: Carlos Garnacho Date: Sat, 5 Oct 2019 10:34:07 +0000 (+0200) Subject: keyboard: Update to ::last-device-changed parameter change X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~781^2^2~87 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=8d88a9b9c4bebf74cccbe4b49eaad30513591364;p=gnome-shell.git keyboard: Update to ::last-device-changed parameter change https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/760 --- diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 0ff8d9a3a..9f0dbd844 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -1102,13 +1102,10 @@ var KeyboardManager = class KeyBoardManager { this._a11yApplicationsSettings = new Gio.Settings({ schema_id: A11Y_APPLICATIONS_SCHEMA }); this._a11yApplicationsSettings.connect('changed', this._syncEnabled.bind(this)); - this._lastDeviceId = null; - Meta.get_backend().connect('last-device-changed', (backend, deviceId) => { - let manager = Clutter.DeviceManager.get_default(); - let device = manager.get_device(deviceId); - + this._lastDevice = null; + Meta.get_backend().connect('last-device-changed', (backend, device) => { if (device.get_device_name().indexOf('XTEST') < 0) { - this._lastDeviceId = deviceId; + this._lastDevice = device; this._syncEnabled(); } }); @@ -1116,16 +1113,11 @@ var KeyboardManager = class KeyBoardManager { } _lastDeviceIsTouchscreen() { - if (!this._lastDeviceId) - return false; - - let manager = Clutter.DeviceManager.get_default(); - let device = manager.get_device(this._lastDeviceId); - - if (!device) + if (!this._lastDevice) return false; - return device.get_device_type() == Clutter.InputDeviceType.TOUCHSCREEN_DEVICE; + let deviceType = this._lastDevice.get_device_type(); + return deviceType == Clutter.InputDeviceType.TOUCHSCREEN_DEVICE; } _syncEnabled() {